package com.itheima.pojo;

import lombok.Data;

import javax.swing.*;

@Data
public class Result {
    private Integer code;
    private String msg;
    private Object date;

    public Result() {
    }

    public Result(Integer code, String msg, Object date) {
        this.code = code;
        this.msg = msg;
        this.date = date;
    }

    public static Result success(Object date){

        return new Result(1,"success",date);
    }

    public static Result success(){
        return new Result(1,"success",null);
    }

    public static Result error(String msg){
        return new Result(0,msg,null);
    }
}
